import {
	createRouter,
	createWebHashHistory
} from 'vue-router'
import MainLayout from '../views/MainLayout.vue'
import HomeView from '../views/HomeView.vue'

const routes = [{
		path: "/",
		components: { default: MainLayout, home: HomeView },
		meta: { requiredLogin: true },
		children: [
			{ path: "", components: { home: HomeView }
			}, 
			{ path: "home", components: { home: HomeView }
			}, 
			{ path: "teacher",
			  components: { home: () => import('../views/Teacher.vue') }
			},
			{ path: "choice",
			  components: { home: () => import('../views/choiceView.vue') }
			},
			{ path: "choiceStudent",
			  components: { home: () => import('../views/ChoiceStudent.vue') }
			},
			{ path: "chat",
			  components: { home: () => import('../views/ChatView.vue') }
			},
			{ path: "about",
			  components: { home: () => import('../views/AboutView.vue') }
			}	 ]
	},
	{
		path: '/login',
		name: 'login',
		component: () => import('../views/login.vue')
	}
]

const router = createRouter({
	history: createWebHashHistory(),
	routes
})

export default router